<template>
        <div class="memberuser" v-loading="state.loading">
            <el-card>
                <template #header>
                    <div class="card-header clearfix">
                            <span class="headerTitle">{{state.title}}</span>
                            <div class="floatRight">
                                <el-button type="primary" v-if="isAuthBtn('add')" ><i class="fa fa-send"></i>新增</el-button>
                            </div>
                    </div>
                </template>
            </el-card>
        </div>
    </template>
        
    <script lang="ts" setup name="memberuser">
        import { toRefs,ref, reactive,onMounted, defineComponent } from 'vue';
        import { useRouter } from 'vue-router'
        import { ElNotification, ElMessage ,ElMessageBox ,FormRules,ElTree} from 'element-plus'
        
        const router = useRouter();
        
        const state = reactive({
            roleBtn:router.currentRoute.value.meta.roleBtn,
            title:router.currentRoute.value.meta.title,
            btnloading:false,
            loading:true,
            dataList:[],
            pages: {
                isAll: false,
                pageCount: 0,
                pageSize: 10,
                recordCount: 0,
                pno: 1
              },
        });
        // 权限判断
        const isAuthBtn = (e) => {
            let auth=false;
            if(e){
                for(let p of state.roleBtn){
                    if(p==e){
                        auth=true;
                    }
                }
            }
            return auth;
        };
        // 跳转
        const tourl = (e) => {
            router.push(e);
        };
        
        onMounted(()=>{
              // 获取当前路由实例参数
            //   console.dir(router.currentRoute.value.query.id);
            //   console.dir(router.currentRoute.value.meta.roleBtn);
              if(!isAuthBtn('index')){
                  router.push('/401');
              }else{
                  //操作函数
                  state.loading=false;
              }
        })
    </script>
        
    <style scoped lang="scss">
        .memberuser{
            padding:5px;
        }
    </style>
        